/**
 * ReportGear(2011)
 */
package net.abbp.report.designer.applet;

import java.awt.BorderLayout;

import javax.swing.JApplet;
import javax.swing.UIManager;

import net.abbp.swing.util.GuiUtils;
import netscape.javascript.JSObject;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.jidesoft.utils.Lm;
import com.reportgear.designer.view.menu.DesignerMenu;
import com.reportgear.report.setting.AppletSettings;
import com.reportgear.report.setting.ApplicationContext;

/**
 * 电信简历设计器Applet面板
 * 
 * @version 1.0
 * @author <a herf="lexloo@gmail.com">lexloo</a>
 * @since abbp 1.0
 */
public class ResumeDesignerApplet extends JApplet {
    private static final long serialVersionUID = 8755103544936493134L;

    static {
        Lm.verifyLicense("Digital China", "BriskBVM", "eJYwQanZJAjb5eac7o2Pe1WeZ1htbGP1");
    }
    private static final Logger logger = LoggerFactory.getLogger(ResumeDesignerApplet.class.getName());

    public void init() {
        super.init();

        ApplicationContext.INSTANCE.setApplet(true);
        AppletSettings appletSettings = AppletSettings.INSTANCE;
        appletSettings.setJsObject(JSObject.getWindow(this));

        initComponents();
    }

    public void start() {
        logger.info("启动简历设计器");
    }

    public void stop() {
        logger.info("停止简历设计器");
    }

    public void destroy() {
        logger.info("销毁简历设计器");
    }

    private void initComponents() {
        try {
            UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
        } catch (Exception e) {
            e.printStackTrace();
        }

        GuiUtils.setDefaultUIFont("宋体");

        this.setLayout(new BorderLayout());
        this.add(new ResumeDesigner(), BorderLayout.CENTER);
        this.setJMenuBar(new DesignerMenu());
    }
}
